package com.ruoyi.web.controller.system.Fdongbei;


import com.github.pagehelper.PageHelper;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.system.Fdongbei.domain.SysConfig;
import com.ruoyi.system.Fdongbei.domain.TbGuozhong;
import com.ruoyi.system.Fdongbei.service.ITbGuozhongService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

import java.util.List;
import java.util.Map;

import static com.ruoyi.common.core.domain.AjaxResult.success;
import static com.ruoyi.common.utils.PageUtils.startPage;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author fufeng
 * @since 2024-12-05
 */
@RestController
@RequestMapping("/system/Fdongbei/tbguozhong")
public class TbGuoZhongController  extends BaseController {


    @Resource
    ITbGuozhongService iTbGuozhongService;

    @GetMapping("/tbGuozhongExists")
    public AjaxResult tbGuozhongExists(String chehao) {
        return success(iTbGuozhongService.tbGuozhongExists(chehao));
    }

    @PostMapping("/tbGuozhonginsert")
    public AjaxResult tbGuozhonginsert(@RequestBody TbGuozhong tbGuozhong) {
        return success(iTbGuozhongService.tbGuozhongInsert(tbGuozhong));
    }

    @GetMapping("/countguozhong")
    public AjaxResult countguozhong(String ddbh){
      return success(iTbGuozhongService.countguozhong(ddbh));
    }

    @PostMapping("/tbGuozhonginsertsd")
    public AjaxResult tbGuozhonginsertsd(@RequestBody TbGuozhong tbGuozhong) {

        if(tbGuozhong != null){
            System.out.println("有数据");
        }
        return success(iTbGuozhongService.tbGuozhonginsertsd(tbGuozhong));
    }

    @PostMapping("/tbGuozhonginsertsh")
    public AjaxResult tbGuozhonginsertsh(@RequestBody TbGuozhong tbGuozhong) {

        if(tbGuozhong != null){
            System.out.println("有数据");
        }
        return success(iTbGuozhongService.tbGuozhonginsertsh(tbGuozhong));
    }



    @PostMapping("/tbGuozhonginsertzz")
    public AjaxResult tbGuozhonginsertzz(@RequestBody TbGuozhong tbGuozhong) {

        if(tbGuozhong != null){
            System.out.println("有数据");
        }
        return success(iTbGuozhongService.tbGuozhonginsertzz(tbGuozhong));
    }




    @GetMapping("/list")
    public TableDataInfo selectyccl(String sql) {
        startPage();
        List<TbGuozhong> list = iTbGuozhongService.selectyccl(sql);
        return getDataTable(list);
    }


    @GetMapping("/selectByCzbh")

    public  AjaxResult selectByCzbh(String czbh){
       return success(iTbGuozhongService.selectByCzbh(czbh));
    }


    @PostMapping("/deleteguozhongbyczbh")
    public AjaxResult deleteguozhongbyczbh(@RequestBody String czbh){
        return success(iTbGuozhongService.deleteguozhongbyczbh(czbh));
    }

    @GetMapping("/deletedaijinchang")

    public AjaxResult deletedaijinchang( String czbh) {
        return success(iTbGuozhongService.deletedaijinchang(czbh));
    }


    @GetMapping("/updategbztbyczbh")

    public AjaxResult updategbztbyczbh(String czbh){
        return success(iTbGuozhongService.updategbztbyczbh(czbh));
    }


    @GetMapping("/zhuanyunbiaoji")
    public AjaxResult zhuanyunbiaoji(String czbh, String gbzt){
        return success(iTbGuozhongService.zhuanyunbiaoji(czbh,gbzt));
    }
}

